package com.zzh.jdis;
/*
 * @Auther : wenrouyue
 * @Date : 2022/2/28-0:42
 */

import jdk.nashorn.internal.scripts.JD;
import org.junit.Test;
import redis.clients.jedis.Jedis;

import java.util.Set;

public class JedisDemo1 {
    public static void main(String[] args) {
        Jedis jedis = new Jedis("124.223.86.30",6379);
        System.out.println(jedis.ping());
    }
    @Test
    public void demo1(){
        Jedis jedis = new Jedis("124.223.86.30",6379);
        jedis.set("name","lucy");
        String name = jedis.get("name");
        System.out.println(name);
        Set<String> keys = jedis.keys("*");
        for (String key :
                keys) {
            System.out.println(key);
        }
    }
}
